package com.indicatorcalculation.lk

import org.apache.spark.sql.SparkSession

object IndicatorCalculation04 {

  def main(args: Array[String]): Unit = {

    val spark = SparkSession.builder()
      .appName("IndicatorCalculation04")
      .config("spark.sql.warehouse.dir","hdfs://master:9000/user/hive/warehouse")
      .enableHiveSupport()
      .getOrCreate()

    //TODO 读取HIVE中的表
    val lineitem = spark.sql("select * from dwd.lineitem_lk")


    val notReturnOrderCount = lineitem.filter("shipstruct !='TAKE BACK RETURN'").count()

    println("未被退回的订单数量为：" + notReturnOrderCount)

    spark.stop()









  }

}
